/* eslint-disable simple-import-sort/imports */
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn';

import formCreate from '@form-create/tdesign';
import TDesign from 'tdesign-vue-next';
import { createApp } from 'vue';

import App from './App.vue';
import i18n from './locales';
import router from './router';
import { store } from './store';

import '@/style/index.less';
import 'tdesign-vue-next/es/style/index.css';
import VueUeditorWrap from 'vue-ueditor-wrap';
import './permission';

const app = createApp(App);

app.use(VueUeditorWrap);
app.use(TDesign);
app.use(store);
app.use(router);
app.use(i18n);
app.use(formCreate);
app.mount('#app');

// 配置Element Plus中文语言包
app.use(ElementPlus, {
  locale: zhCn,
  size: 'default',
});

// 配置Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
